#ifndef HANDWRITEMODEL_H
#define HANDWRITEMODEL_H

#include "entity/characteritem.h"
#include "entity/characterentity.h"
#include "entity/wordentity.h"
#include <qlist.h>

#define MAXDIST 100000
#define MAX_DIFF_PER_STROKE 35000
#define VERTICAL 1001
#define HORIZONTAL 1002

class HandWriteModel
{
public:
    HandWriteModel();

    bool loadModelFileNew(const char* filePath);
    bool recognize(CharacterEntity ch, QStringList *resultWords);
    static void getTurnPoints(CharacterEntity* character);
    static void turnPoints(StrokeEntity *stroke, std::vector<PointEntity> *points, int pointIndex1, int pointIndex2);

private:
//    std::vector<CharacterEntity> characters;
    QList<CharacterItem> charItems;
    double dist(const CharacterEntity* character1, const CharacterEntity* character2);
    double distBetweenStrokes(const StrokeEntity stroke1, const StrokeEntity stroke2);

    void norm(CharacterEntity* character);

};

#endif // HANDWRITEMODEL_H
